<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .node{
            color:#f0f;
        }
        .n-1{
            font-size:28px;
        }
    </style>
</head>
<body>
<p>DOM:document object model 文档对象模型</p>
<div id="node-list">

</div>
<p id="show-val"></p>
</body>
<script>
    var showVal = document.getElementById('show-val')
    var node = document.createElement('div')
    var txt = document.createTextNode("new node")
    node.appendChild(txt)
    node.setAttribute("class","node n-1")
    node.setAttribute("data-name","node-1")
    node.className = node.className.replace(/node/,'')
    showVal.innerHTML = node.className
    document.getElementById('node-list').appendChild(node)



    function Fun(){
        var getName = function(){
            console.log(1);
        }
        console.log(this)
        return this;
    }

    Fun()
</script>
</html>